package com.liangzhong.modules.court.CourtCommand
{
	import com.liangzhong.proxy.cour.CourtProxy;
	import com.liangzhong.proxyconstant.court.CourtProxyConstant;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	/**
	 * 球场 
	 * @author Administrator
	 * 
	 */	
	public class CourtCommand extends SimpleCommand
	{
		public function CourtCommand()
		{
			super();
		}
		override public function execute(notification:INotification):void
		{
			switch(notification.getName())
			{
				case CourtProxyConstant.COURT_MEDIATORTOCOMMAND://mediator处理
					mediatorNotification(notification);
					break;
			}
		}
		/**
		 * clubMediator -->clubCommand 通知
		 * @param notification
		 * 
		 */		
		private function mediatorNotification(notification:INotification):void
		{
			var courtProxy:CourtProxy = facade.retrieveProxy(CourtProxy.PROXYNAME) as CourtProxy;
			switch(notification.getType())
			{
				case CourtProxyConstant.COURT_INFO:
					courtProxy.requestCourtInfo();
					break;
				case CourtProxyConstant.COURT_UP:
					courtProxy.requestCourtUp();
					break;
				case CourtProxyConstant.CLEAR_UP_TIME:
					courtProxy.requestClearUpTime(notification.getBody());
					break;
			}
		}
	}
}